package com.lwm.annotationandreflection.ref;

/**
 * @author liweimin
 * @date 2020/9/25 11:14
 * @description
 */
public class ref06 {
    public static void main(String[] args) throws ClassNotFoundException {
        //系统加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);
        //获取系统类的加载器的父类加载器--->扩展类加载器
        ClassLoader parent = systemClassLoader.getParent();
        System.out.println(parent);
        //获取扩展类加载器的父类加载器--->根加载器（C++）
        ClassLoader parent1 = parent.getParent();
        System.out.println(parent1);


        Class clazz = Class.forName("java.lang.Integer");
        ClassLoader classLoader = clazz.getClassLoader();
        System.out.println(classLoader);

/**
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\deploy.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\javaws.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfxswt.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\management-agent.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\plugin.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;
 * C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;
 * G:\gitee\Java-8\out\production\Java-8;
 * E:\maven-repository\junit\junit\4.12\junit-4.12.jar;
 * E:\maven-repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;
 * C:\IntelliJ IDEA 2020.1.4\lib\idea_rt.jar
 */
        System.out.println(System.getProperty("java.class.path"));

        /**
         * 双亲委派机制
         */
    }
}
